<style scoped>
  .expand-row{
    margin-bottom: 16px;
  }
  .lyx-table-btn{
    margin-right: 5px;
    margin-bottom: 2px;
  }
  .title-size {
    font-weight: bold;
    font-size: 1rem;
  }
  .ivu-form-item-contenttype {
    position: relative;
    line-height: 32px;
    font-size: 12px;
    display: flex;
  }
   .ivu-form-item-contenttype  blockquote, body, button, dd, div, dl, dt, form, h1, h2, h3, h4, h5, h6, input, li, ol, p, pre, td, textarea, th, ul {
    /*margin: 1px;*/
  }
</style>
<template>
    <div class="aa">
      <Form label-position="right" :label-width="100" style="position: relative;" :model="formDate">
        <Row class="mb20">
          <Col span="14" class="ivu-form-item-label title-size" style="font-weight: 500">登记年审信息</Col>
        </Row>
       <!-- <Row class="mb20">
          <Col span="8" class="ivu-form-item-label">档案编号：</Col>
          <Col span="9" offset="1" class="ivu-form-item-content">
            <Input v-model="formDate.name" ></Input>
          </Col>
        </Row>-->
        <Row class="mb20">
          <Col span="8" class="ivu-form-item-label">申请人姓名：</Col>
          <Col span="9" offset="1" class="ivu-form-item-content">
            <Input v-model="formDate.applyPerson" ></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="8" class="ivu-form-item-label">申请人身份证号：</Col>
          <Col span="9" offset="1" class="ivu-form-item-content">
            <Input v-model="formDate.applyIdCard" ></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="13" class="ivu-form-item-label title-size">年审</Col>
        </Row>
        <Row class="mb20">
          <Col span="8" class="ivu-form-item-label">申请人类型：</Col>
          <Col span="12" offset="1" class="ivu-form-item-content">
            <div style="width: 100%;float: left">
              <CheckboxGroup  v-model="person_type_list" v-for="(item,index) in ruleData.personTypeList" :key="index" >
                <Checkbox :label="item.personTypeCode" style="width: max-content;float: left">{{item.personTypeName}}</Checkbox>
              </CheckboxGroup>
            </div>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="8" class="ivu-form-item-label">年审是否通过：</Col>
          <Col span="9" offset="1" class="ivu-form-item-content">
            <Checkbox v-model="formDate.nstg">是</Checkbox>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="8" class="ivu-form-item-label">本次年审有效期限：</Col>
          <Col span="9" offset="1" class="ivu-form-item-content">2019-03-13 至2020-03-12</Col>
        </Row>
        <Row class="mb20">
          <Col span="8" class="ivu-form-item-label">收入情况：</Col>
          <Col span="4" offset="1" class="ivu-form-item-content">
<!--            <Checkbox v-model="formDate.isIncome">符合</Checkbox>-->
            <RadioGroup v-model="formDate.isIncome">
              <Radio v-for="item in isIncomee" :value="item.value" :key="item.value" :label="item.value">{{item.label}}</Radio>
            </RadioGroup>
          </Col>
          <Col span="2" class="ivu-form-item-label">人均</Col>
          <Col span="3" class="ivu-form-item-content">
            <Input v-model="ruleData.averageMoney" disabled></Input>
          </Col>
          <Col span="2" class="ivu-form-item-label">元/月</Col>
        </Row>
        <Row class="mb20">
          <Col span="8" class="ivu-form-item-label">住房情况：</Col>
          <Col span="4" offset="1" class="ivu-form-item-content">
          <!--  <Checkbox v-model="formDate.isHousing" >符合</Checkbox>-->
            <RadioGroup v-model="formDate.isHousing">
              <Radio v-for="item in isHousingg" :value="item.value" :key="item.value" :label="item.value">{{item.label}}</Radio>
              <!--<Radio label="0">不符合</Radio>-->
            </RadioGroup>
          </Col>
          <Col span="2" class="ivu-form-item-label">人均</Col>
          <Col span="3" class="ivu-form-item-content">
            <Input v-model="ruleData.averageArea" disabled></Input>
          </Col>
          <Col span="2" class="ivu-form-item-label">平方米</Col>
        </Row>
        <Row class="mb20">
          <Col span="8" class="ivu-form-item-label">人口变化情况：</Col>
          <Col span="9" offset="1">
            <Input v-model="formDate.perNumMemo" type="textarea" :rows="3" />
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="8" class="ivu-form-item-label">其他变化情况：</Col>
          <Col span="9" offset="1">
            <Input v-model="formDate.otherMemo" type="textarea" :rows="3" />
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="8" class="ivu-form-item-label">请选择年审年份：</Col>
          <Col span="9" offset="1">
<!--            <DatePicker type="date" v-model="formDate.auditYear" style="width: 363px"></DatePicker>-->
            <Select v-model="formDate.auditYear" style="width:200px">
              <Option v-for="item in monthListaa" :value="item" :key="item"> {{item}}</Option>
            </Select>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="8" class="ivu-form-item-label">情况说明：</Col>
          <Col span="9" offset="1">
            <Input v-model="formDate.committeeAuditMemo" type="textarea" :rows="3" />
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="8" class="ivu-form-item-label">社区经办人：</Col>
          <Col span="9" offset="1">
            <Input v-model="formDate.committeeHandler" ></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="8" class="ivu-form-item-label">社区负责人：</Col>
          <Col span="9" offset="1">
            <Input v-model="formDate.committeePrincipal" ></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="13" class="ivu-form-item-label">
            <Button @click="save()">提交</Button>
          </Col>
        </Row>
      </Form>
    </div>
</template>
<script>
// import { itemParamByOrderList } from '@/api/eventlist'
export default {
  name: 'Form4',
  data () {
    return {
      bwk: '0',
      paramsArr: [],
      list: [],
      person_type_list: [],
      isHousingg: [{ value: 1, label: '符合' }, { value: 0, label: '不符合' }],
      isIncomee: [{ value: 1, label: '符合' }, { value: 0, label: '不符合' }]
    }
  },
  props: {
    formDate: {
      nstg: true
    },
    ruleData: {},
    monthListaa: Array,
    personTypeList: Array
  },
  mounted () {
    if (this.formDate.personTypes) {
      this.person_type_list = this.formDate.personTypes.split(',')
      console.log(this.person_type_list, '申请人类型')
    }
  },
  watch: {
    // params (ret) {
    //   console.log(ret)
    // }
  },
  methods: {
    aa () {
      if (this.person_type_list) {
        this.formDate.personTypes = this.person_type_list.join(',')
      }
    },
    bb () {
      if (this.ruleData.averageMoney) {
        this.formDate.averageMoney = this.ruleData.averageMoney
      }
    },
    cc () {
      if (this.ruleData.averageArea) {
        this.formDate.averageArea = this.ruleData.averageArea
      }
    },
    save () {
      console.log(this.ruleData.personTypeList, '申办人类型')
      this.aa()
      // 判断必填字段是否为空
      if (this.formDate.personTypes === undefined || this.formDate.personTypes === '') {
        this.$Notice.error({ title: '请选择申请人类型', desc: '' })
        return false
      } else if (!this.formDate.nstg) {
        this.$Notice.error({ title: '请填写申请人年审是否通过', desc: '' })
        return false
      } else if (this.formDate.isIncome === undefined) {
        this.$Notice.error({ title: '请填写申请人收入情况是否符合', desc: '' })
        return false
      } else if (this.formDate.isHousing === undefined) {
        this.$Notice.error({ title: '请填写申请人住房情况是否符合', desc: '' })
        return false
      } else if (!this.formDate.auditYear) {
        this.$Notice.error({ title: '请选择年审月份', desc: '' })
        return false
      } else if (!this.formDate.committeeHandler) {
        this.$Notice.error({ title: '请填写年审经办人', desc: '' })
        return false
      } else if (!this.formDate.committeePrincipal) {
        this.$Notice.error({ title: '请填写年审负责人', desc: '' })
        return false
      } else {
        console.log(this.formDate)
        this.bb()
        this.cc()
        this.$emit('ee')
      }
    }
    // async rowList () {
    //  let params = this.params
    //  let temp = []
    //  temp.push({ type: 'info', size: 'small', c: 1, data: params.row, name: '进度' })
    //  if (params.row.state === '2') {
    //    temp.push({ type: 'info', size: 'small', c: 2, data: params.row, name: '打印通知单' })
    //  }
    //  if (params.row.form_url) {
    //    temp.push({ type: 'info', size: 'small', c: 6, data: params.row, name: '打印表格' })
    //  }
    //  let action1 = evil('(' + params.row.action + ')')
    //  for (let key in action1) {
    //    if (action1[key].type === 'button' && action1[key].next_process_id === '-1') {
    //      let key1 = ''
    //      let key2 = ''
    //      let acs = 3
    //      if (action1[key].params_type) {
    //        key1 = action1[key]
    //        key2 = key
    //        acs = 3
    //      } else {
    //        key1 = key
    //        key2 = action1[key]
    //        acs = 4
    //      }
    //      temp.push({ type: 'success', size: 'small', c: acs, data: { data: params.row, key1: key1, key2: key2 }, name: action1[key].name })
    //    }
    //  }
    //  if (params.row.params && params.row.params !== '{}') {
    //    let param = { id: params.row.item_id, code: params.row.code }
    //    let ax = await itemParamByOrderList(param)
    //    this.paramsArr = ax.data.data
    //    for (let i = 0; i < this.paramsArr.length; i++) {
    //      if (this.paramsArr[i].write_type === 'images') {
    //        temp.push({ type: 'info', size: 'small', c: 5, data: this.paramsArr[i].img_url, name: '查看' + this.paramsArr[i].name })
    //      }
    //    }
    //  }
    //  this.list = temp
    // },
    // async abc () {
    //   let a = await itemParamByOrderList({})
    //   console.log(a, '执行节藕')
    //   this.bwk = a.data
    //   this.$emit('run', { a: 1 })
    // },
    // goRun (type, data) {
    //  this.$emit('breachRun', type, data)
    // }
  }
}
</script>
